package com.dubbo;

import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.dubbo.consumer.quickstart.QuickstartConsumer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Scanner;

/**
 * Hello world!
 *
 */
@SpringBootApplication
@EnableDubboConfiguration
public class ConsumerApp
{

    public static void main( String[] args ) {
        ConfigurableApplicationContext run = SpringApplication.run(ConsumerApp.class,args);
        QuickstartConsumer bean = run.getBean(QuickstartConsumer.class);
        while(true){
            Scanner in = new Scanner(System.in);
            String next = in.next();
            bean.sendMessage(next);
        }
    }

}
